TARGET_NAME=rapport

# can add : pdflatex -interaction=batchmode


all: $(TARGET_NAME)
	pdflatex -output-directory build -halt-on-error -file-line-error -halt-on-error $(TARGET_NAME).tex
	mv build/$(TARGET_NAME).pdf .

$(TARGET_NAME): build
	pdflatex -output-directory build -draftmode -halt-on-error -file-line-error $(TARGET_NAME).tex

build:
	mkdir -p build

.PHONY: clean cleanall

clean:
	rm -f *.aux *.log *.nav *.out *.snm *.toc *.dvi
	$(shell echo "if [ -e build ] ; then rm -rf build; fi")

cleanall: clean
	rm -f $(TARGET_NAME).pdf

